<?php
namespace app\index\model;
use think\Loader;
class DiaoduModel extends \think\Model{
	function send($content,$duan){
		Loader::import('app.index.model.Yprint');
		//include("print.class.php");
		$print = new \Yprint();
		
		/*虎门大市场*/
		$p_con01=array(
			"machine_code"=>'4004509769',//打印机终端号
			"msign"=>'ts254uzri4vt'//打印机密钥
		);
		
		/*虎门博美店*/
		$p_con02=array(
			"machine_code"=>'4004513841',//打印机终端号
			"msign"=>'7qs3i8p8wqax'//打印机密钥
		);
		
		switch($duan){
			case 'dsc':
				$conf=$p_con01;
				break;
			case 'bm':
				$conf=$p_con02;
				break;
		}
		
		$conf['partner']='4843';
		$conf['apiKey']="37bcb1972c920fb60383a687c30f9f2001004488";
		
		//打印
		$ac=$print->action_print($conf['partner'],$conf['machine_code'],$content,$conf['apiKey'],$conf['msign']);
		return $ac;
		//添加打印机
		//$print->action_addprint(407,'4004508952','wajuka','k2s测试','18111111111',$apikEY,$msign);
		//删除打印机
		//$print->action_removeprinter(407,'4004508952',$apiKey,$msign);
	}

}
?>